
let mixins = require('../utils/mixins');

const templateDiv = `
    <div><span id="name">title</span></div>
    <div id="content">
        
    </div>`;

const DefaultOptions = {
    name:'',
};

class Panel{
    constructor(options) {

        mixins(options,DefaultOptions);

        this.element = globalThis.document.createElement('div');
        this.element.classList.add('panel');
        this.element.innerHTML = templateDiv;

        this.contentEl = this.element.querySelector('#content');
        this.nameEl = this.element.querySelector('#name');
        this.nameEl.innerText = options.name;
    }

    add(element){
        this.contentEl.appendChild(element);
    }
}

module.exports = Panel;
